#!/usr/bin/env python

"""
LinearDemandCurve.py: A model to represent oxygen updake demand.
"""

class LinearDemandCurve:
	# Instance variables
	VdotO2min = 0.0
	VdotO2max = 0.0
	VatVdotO2max = 0.0
	m = 0.0

	def getDemand( self, v ):
		D = []
		for vi in v:
			D.append( self.m*vi + self.VdotO2min )
		return D

	# Constructor
	def __init__( self, VdotO2min, VdotO2max, VatVdotO2max ):
		self.VdotO2min = VdotO2min
		self.VdotO2max = VdotO2max
		self.VatVdotO2max = VatVdotO2max
		self.m = ( self.VdotO2max - self.VdotO2min ) / self.VatVdotO2max;
		
